Don't mutate this.options (fixes #824) #826
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned in #824, modifying the options object causes webpack to error if you run it more than once with the same config.
This PR stops
lib/loader.js
from settingthis.options.__vueoptions__
and stops any other file from relying on it. I'm not sure if any other loader relies on this key, anything that does would be broken by this PR.I've also had to rely on checking
this._compiler.constructor.name
inlib/style-compiler/index.js
to check for happypack, I'm pretty sure that's what the original line was doing? It doesn't feel good but it will work. I don't have any experience with happypack, so I can't confirm if this makes a difference.It passes all tests, I didn't think the changes needed a new test but I can write one if needed.
Hopefully I havn't missed anything!